/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/',
    component: () => import('@/views/layouts/index'),
    redirect: '/home',
    meta: {
      title: '筑台青创',
      keepAlive: true
    },
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import('@/views/home/index'),
        meta: { title: '筑台青创', keepAlive: true }
      },
      {
        path: '/user',
        name: 'User',
        component: () => import('@/views/user'),
        meta: { title: '个人中心', keepAlive: true }
      },
    ]
  },
  {
    path: '/news/:type',
    name: 'news',
    component: () => import('@/views/news'),
    // isback 用于区分不同场景访问该页面是否需要缓存的判断
    meta: { title: '资讯中心', keepAlive: true, isBack: false }
  },
  {
    path: '/newsList/:type/:subType',
    name: 'newsList',
    component: () => import('@/views/news/newsList'),
    // isback 用于区分不同场景访问该页面是否需要缓存的判断
    meta: { title: '资讯列表', keepAlive: true, isBack: false }
  },
  {
    path: '/news/detail/:id',
    name: 'NewsDetail',
    component: () => import('@/components/NewsDetail'),
    meta: { title: '资讯详情', keepAlive: true }
  },
  {
    path: '/user/edit',
    name: 'UserEdit',
    component: () => import('@/views/user/edit'),
    meta: { title: '资料编辑', keepAlive: false }
  },
  {
    path: '/user/card',
    name: 'UserCard',
    component: () => import('@/views/user/card'),
    meta: { title: '身份验证', keepAlive: false }
  },
  {
    path: '/user/inviter',
    name: 'UserInviter',
    component: () => import('@/views/user/inviter'),
    meta: { title: '邀请码', keepAlive: false }
  },
  {
    path: '/commercialTenant',
    name: 'commercialTenant',
    component: () => import('@/views/commercialTenant'),
    meta: { title: '商户列表', keepAlive: true }
  },
  {
    path: '/commercialTenant/:type/:id?',
    name: 'commercialTenantEdit',
    component: () => import('@/views/commercialTenant/edit'),
    meta: { title: '新增商户', keepAlive: false }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login'),
    meta: { title: '登陆', keepAlive: false }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/login/register'),
    meta: { title: '登陆', keepAlive: false }
  },
  {
    path: '/updatePassword',
    name: 'UpdatePassword',
    component: () => import('@/views/login/updatePassword'),
    meta: { title: '修改密码', keepAlive: false }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404'),
    meta: { title: '暂无此页', keepAlive: false }
  },
  { path: '*', redirect: '/404' }
]
